<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="content-type" content="text/html;charset=UTF-8">
		<script type="text/javascript" src="../dojo/dojo/dojo.js" djConfig="isDebug: true, parseOnLoad: true,modulePaths:{'lorelei': '/js/lorelei'}"></script>
		<style type="text/css">
		@import "../dojo/dijit/tests/css/dijitTests.css";
		@import "../dojo/dojo/resources/dojo.css";
		@import "/css/lorelei.css";
		</style>
		<link id="themeStyles" rel="stylesheet" href="../dojo/dijit/themes/tundra/tundra.css">
		<script type="text/javascript">
		dojo.require("dojo.parser");	// scan page for widgets and instantiate them
		dojo.require("dijit.form.Form");
		dojo.require("dijit.form.Button");
		dojo.require("dijit.form.TextBox");
		dojo.require("dijit.form.CheckBox");
		dojo.require("dijit.form.SimpleTextarea");
		dojo.require("lorelei.mml.player");
		</script>
		<title>MabiMMLをJSMMLかMIDIで再生するテスト</title>
	</head>

	<body class="tundra" style="padding:20px">
		<h1 class="testTitle">Textarea Player</h1>
		<p>MMLプレイヤーのテストページ。下のフォームには、<a href="http://mabinogi.logue.be/ja/articles/">投稿されているMMLの記事番号</a>を入れてください</p>
		<label for="article_id">記事番号：</label><input type="text" dojoType="dijit.form.TextBox" id="article_id" value="1" onchange="lorelei.mml.player.id = this.value; lorelei.mml.player.changed=true;" />
		&nbsp;
		<input type="radio" name="PlayType" value="midi" id="midi" dojoType="dijit.form.RadioButton" checked="checked" /><label for="midi">MIDI</label>
		<input type="radio" name="PlayType" value="jsmml" id="jsmml" dojoType="dijit.form.RadioButton" /><label for="jsmml">JSMML</label>
		<input type="radio" name="PlayType" value="flmml" id="flmml" dojoType="dijit.form.RadioButton" /><label for="flmml">FLMML</label>
		&nbsp;
		<button dojoType="dijit.form.Button" onclick="test();">Test</button>
		&nbsp;
		<button dojoType="dijit.form.Button" iconclass="LoreleiIcon LoreleiIconPlayerPlay" id="play">演奏</button>
		<button dojoType="dijit.form.Button" iconclass="LoreleiIcon LoreleiIconPlayerStop" id="stop">停止</button>
		<br />
		<textarea id="score" dojoType="dijit.form.SimpleTextarea" rows="8" cols="50">
t60l16 o5r cdefedc8 efgagfe8 c4 c4 c4 c4 ccddeeffe8d8c4</textarea>
		<div id="media"></div>
<script>

dojo.addOnLoad(function(){
	lorelei.mml.player.PlayButton = dijit.byId('play');
	lorelei.mml.player.StopButton = dijit.byId('stop');
	lorelei.mml.player.Container = dojo.byId('media');
	lorelei.mml.player.PauseLabel = '一時停止';
	dojo.query("input[name='PlayType']").connect('onclick',function(item){
		lorelei.mml.player.selector(item.target.value);
	});
	lorelei.mml.player.id = dojo.byId('article_id').value;
	lorelei.mml.player.init();
});

var message = {
	quicktime_required : 'To play MML by MIDI, QuickTime has required.',
	flash_requied : 'To play MML by FLMML and JSMML, Adobe Flash has required.'
};



function test(){
	var mmldata = [
		'v9l64c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&c&cv0c2t144v15<d6l12der6fr6grd4der6fr>f<grd4der>>d24d+24n41rc<<grd4der>b+<fr>a<gr<g4gar6a+r>>e<cr<g4garn57a+r>>g<cr<g4gar6a+>gn34ar<g4garn62a+r6>c4d&dder6fr6grd4der6fr>f<grd4der>>d24d+24n41rc<<grd4der>b+<fr>a<gr<g4gar6a+r>>e<cr<g4garn57a+r>>a+<cr<g4gar6a+>gn34ar<g4gar6a+r6>c4>g2g6rl6ef4g4d4e3g2gabl24>cd&d6<b6a4b4ag+g2l6gr12ef4g4d4e3g2gab>c24d24&dc-e2l12eo2a6abr6>cr6l24fgab<a4l12abr6>cr6d6<a4abr6>cr6d6<a4abr6>c>de<d6<a4abr6>cr6d6<a4abr6>cr6d6<a4abo5g6<<cr6d6<a4abr6>cr6d6',
 		'r1v15l2>c.&c6cl12rcdcd6c2rer3dr6<br4ar6arg2&gd6rgrb+r6a+r4gr3>g2rg6de6f4er3rd4rc2.&c6c2rcdcd6c2rer3dr6<br4ar6arg2&gd6rgrb+r6a+r4gr3>g2rg6derf4er6dr6d4r<d2l6dd2.r4d3d1.rd3d2&dd2.r4d3d1.rd3g2.r4b>cdedcc-3l12c<ab4&b6a24g+24g2r4aa+b2&bb>cdba+rl6c-cdedcc-3l12c<ab4&b6l24ag+g1',
 		'r1v15f2.&f6f2r12f6rf1f1e2.re2l12re6er6e1a+4ar6ar6a4rf2.&f6f2rf6r4f1f1e2.&er6e2re6er6e1a+4ar6ar6a4rl1.<g+r6g+3gr6g3g+r6g+3gr6d3>b2.<d6l24>deg1g1e2l12ef+gff+g1>a1r24f+24g6f+r4f+rg6f+l24rg+a1'
	];
	lorelei.mml.player.Composer = true;
	lorelei.mml.player.inst = 1 // Lute
	lorelei.mml.player.mmls = mmldata;
	lorelei.mml.player.play();
	lorelei.mml.player.Composer = false;
}


</script>
<a href="/phpmyadmin/?db=mabinogi" onclick="window.open(this.href);return false;">Admin</a>
	</body>
</html>
